/*******************************************************************************
 *
 *    Copyright (c) Baina Info Tech Co. Ltd
 *
 *    Best Wallpaper HD
 *    
 *    ShortLaunchHelper
 *    TODO File description or class description.
 *
 *    @author: zuochen
 *    @since:  2011-8-29
 *    @version: 1.0
 *
 ******************************************************************************/

package com.sdk.activity;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Parcelable;

import com.android.sdk.R;


/**
 * ShortLaunchHelper of Best Wallpaper HD.
 * 
 * @author zuochen
 * 
 */

public class ShortLaunchHelper {
	private static final String MOBILE_SITE ="http://m.flikie.com";
	public static void createShortCut(Context context) {
		final Intent addIntent = new Intent(
				"com.android.launcher.action.INSTALL_SHORTCUT");
		final Parcelable icon = Intent.ShortcutIconResource.fromContext(
				context, R.drawable.icon); // 获取快捷键的图标
		addIntent.putExtra("duplicate", false); 
		final Intent myIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(MOBILE_SITE));
		addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME,
				context.getString(R.string.app_name));// 快捷方式的标题
		addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon);// 快捷方式的图标
		addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, myIntent);// 快捷方式的动作
		context.sendBroadcast(addIntent);
	}
//	public static void deleteShortCut(Context context) {
//		final Intent addIntent = new Intent(
//				"com.android.launcher.action.UNINSTALL_SHORTCUT");
//		final Parcelable icon = Intent.ShortcutIconResource.fromContext(
//				context, R.drawable.icon); // 获取快捷键的图标
//		addIntent.putExtra("duplicate", false); 
//		final Intent myIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(MOBILE_SITE));
//		addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME,
//				context.getString(R.string.mobile_site_shortcut_name));// 快捷方式的标题
//		addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon);// 快捷方式的图标
//		addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, myIntent);// 快捷方式的动作
//		context.sendBroadcast(addIntent);
//	}
}
